﻿// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.

using System;

namespace Resp.benchmark
{
    internal static class GeoUtils
    {
        static readonly Random random = new Random();

        static readonly string[,] worldcities = new string[,] {
                {"5.303104" ,"51.68893" ,"Hertogenbosch"},
                {"31.364767" ,"29.83204" ,"15th of May City"},
                {"30.940920" ,"29.972345" ,"6th of October"},
                {"-8.395876" ,"43.371209" ,"A Coruña"},
                {"-13.536958" ,"9.690232" ,"ANSOUMANIYA PLATEAU"},
                {"-13.541464" ,"9.710452" ,"ANSOUMANYAH VILLAGE"},
                {"6.083861" ,"50.776350" ,"Aachen"},
                {"9.921526" ,"57.046262" ,"Aalborg"},
                {"10.213404" ,"56.149627" ,"Aarhus"},
                {"-52.851297" ,"68.709587" ,"Aasiaat"},
                {"7.364349" ,"5.112734" ,"Aba"},
                {"48.259147" ,"30.363609" ,"Abadan"},
                {"-48.878842" ,"-1.721827" ,"Abaetetuba"},
                {"114.972247" ,"44.018620" ,"Abag Banner"},
                {"8.113320" ,"6.320889" ,"Abakaliki"},
                {"91.440355" ,"53.720649" ,"Abakan"},
                {"91.439075" ,"53.694029" ,"Abakan"},
                {"-72.878874" ,"-13.637348" ,"Abancay"},
                {"144.273203" ,"44.020602" ,"Abashiri"},
                {"-122.329479" ,"49.052116" ,"Abbotsford"},
                {"73.213912" ,"34.143658" ,"Abbottabad"},
                {"21.304443" ,"12.808157" ,"Abdi"},
                {"-3.496843" ,"6.726904" ,"Abengourou"},
                {"-98.487813" ,"45.464980" ,"Aberdeen"},
                {"-4.016107" ,"5.320356" ,"Abidjan"},
                {"140.028065" ,"35.863998" ,"Abiko"},
                {"-99.747590" ,"32.446449" ,"Abilene"},
                {"-4.029007" ,"5.435486" ,"Abobo"},
                {"74.195659" ,"30.145054" ,"Abohar"},
                {"1.993632" ,"7.182001" ,"Abomey"},
                {"2.354245" ,"6.453863" ,"Abomey-Calavi"},
                {"13.173869" ,"3.989629" ,"Abong-Mbang"},
                {"19.277614" ,"11.450623" ,"Aboudéïa"},
                {"-8.197361" ,"39.463190" ,"Abrantes"},
                {"-34.898389" ,"-7.900718" ,"Abreu e Lima"},
                {"30.340675" ,"20.793038" ,"Abri"},
                {"33.808781" ,"15.899020" ,"Abu Delelq"},
                {"44.343966" ,"32.527106" ,"Abu Gharaq"},
                {"33.324847" ,"19.537892" ,"Abu Hamad"},
                {"31.233983" ,"11.464672" ,"Abu Jibeha"},
                {"31.670844" ,"30.725169" ,"Abu Kabir"},
                {"40.917058" ,"34.450511" ,"Abu Kamal"},
                {"31.615640" ,"22.356780" ,"Abu Simbel City"},
                {"33.104062" ,"29.051162" ,"Abu Zenima"},
                {"7.489297" ,"9.064330" ,"Abuja"},
                {"20.828365" ,"13.828029" ,"Abéché"},
                {"-89.829760" ,"13.589796" ,"Acajutla"},
                {"-99.894018" ,"16.868049" ,"Acapulco"},
                {"-69.203282" ,"9.550796" ,"Acarigua"},
                {"-0.201237" ,"5.557109" ,"Accra"},
                {"-68.220348" ,"7.788824" ,"Achaguas"},
                {"77.508642" ,"21.2546700" ,"Achalpur"},
                {"126.969444" ,"45.536249" ,"Acheng"},
                {"90.495396" ,"56.269484" ,"Achinsk"},
                {"-68.171014" ,"-16.568099" ,"Achocalla"},
                {"35.083977" ,"32.924004" ,"Acre"},
                {"26.131093" ,"11.461173" ,"Ad Da'ein"},
                {"33.4133374" ,"12.866115" ,"Ad Dali"},
                {"44.9236266" ,"31.985330" ,"Ad Diwaniyah"},
                {"34.3656297" ,"11.807363" ,"Ad-Damazin"},
                {"139.795319" ,"35.783702" ,"Adachi"},
                {"39.2705461" ,"8.541026" ,"Adama"},
                {"35.3252861" ,"36.986359" ,"Adana"},
                {"38.7612524" ,"9.010793" ,"Addis Ababa"},
                {"21.8944538" ,"12.659087" ,"Addé"},
                {"138.599931" ,"-34.928180" ,"Adelaide"},
                {"78.533989" ,"19.675945" ,"Adilabad"},
                {"38.276859" ,"37.763953" ,"Adiyaman"},
                {"-4.0222008" ,"5.353121" ,"Adjamé"},
                {"5.22274" ,"7.623248" ,"Ado Ekiti"},
                {"77.273089" ,"15.625331" ,"Adoni"},
                {"22.197718" ,"13.466456" ,"Adré"},
                {"45.119037" ,"2.146028" ,"Afgooye"},
                {"2.100289" ,"34.112519" ,"Aflou"},
                {"-0.997583" ,"6.37343724" ,"Afosu"},
                {"36.870088" ,"36.508379" ,"Afrin"},
                     };

        public static (string lng, string lat, string mem) GetValidGeo()
        {
            var i = random.Next(worldcities.GetLength(0));
            return (worldcities[i, 0], worldcities[i, 1], worldcities[i, 2]);
        }
    }
}